<?php
include("admin_check.php");
include_once("../class/system_class.php");
session_start();
header("Content-Type: text/html;charset=utf-8");
checkqx(6,31);
	$_system=new system_class();
	$systemparameters=$_system->system_information(1);
	$time=unserialize($systemparameters['txtime']);
	$jingtaitime=unserialize($systemparameters['jingtaitime']);

if($_POST['button']){
		$_system=new system_class();
		$systemparameters['id']=1;
		$systemparameters['txbs']=$_POST['txbs'];
		$systemparameters['txmix']=$_POST['txmix'];
		$systemparameters['txsl']=$_POST['txsl'];
//		$systemparameters['txks']=$_POST['txks'];
		$systemparameters['wlf']=$_POST['wlf'];
		$systemparameters['sl']=$_POST['sl'];
		$systemparameters['xtkg']=$_POST['xtkg'];
		$systemparameters['azkg']=$_POST['azkg'];
		$systemparameters['tjkg']=$_POST['tjkg'];
		$systemparameters['ziliao']=$_POST['ziliao'];
		$systemparameters['ff']=$_POST['ff'];
		$systemparameters['ms']=$_POST['ms'];
		$systemparameters['txxq']=$_POST['txxq'];
		$systemparameters['bdbonus']=$_POST['bdbonus'];
		$systemparameters['isb2']=$_POST['cqu'];
		$systemparameters['isb3']=$_POST['isb3'];
		$systemparameters['qq1']=$_POST['qq1'];
		$systemparameters['qq2']=$_POST['qq2'];
		$systemparameters['qq3']=$_POST['qq3'];
		$systemparameters['qq4']=$_POST['qq4'];
		$systemparameters['password1']=$_POST['password1'];
		$systemparameters['password2']=$_POST['password2'];
		$systemparameters['password3']=$_POST['password3'];
		$systemparameters['duanxinzhanghao']=$_POST['duanxinzhanghao'];
		$systemparameters['duanxinmima']=$_POST['duanxinmima'];
		$systemparameters['aixinjijin']=$_POST['aixinjijin'];
		$systemparameters['fanli']=$_POST['fanli'];
		$systemparameters['dianbaodan']=$_POST['dianbaodan'];
		$systemparameters['danjia']=$_POST['danjia'];
		$systemparameters['jmf1']=$_POST['jmf1'];
		$systemparameters['jmf2']=$_POST['jmf2'];
		$systemparameters['chaifen']=$_POST['chaifen'];
		$systemparameters['chongfuxiaofei']=$_POST['chongfuxiaofei'];
		$systemparameters['fengding']=$_POST['fengding'];
		$systemparameters['rexian']=$_POST['rexian'];
		$systemparameters['shouhou']=$_POST['shouhou'];
		$systemparameters['ds1']=$_POST['ds1'];
		$systemparameters['ds2']=$_POST['ds2'];
		//new add data
		$systemparameters['access_key_id']=$_POST['access_key_id'];
		$systemparameters['access_key_secret']=$_POST['access_key_secret'];
		$systemparameters['sms_admin_tel']=$_POST['sms_admin_tel'];
		$systemparameters['w_appid']=$_POST['w_appid'];
		$systemparameters['w_appsercret']=$_POST['w_appsercret'];
		$systemparameters['w_mchid']=$_POST['w_mchid'];
		$systemparameters['w_key']=$_POST['w_key'];
//		$laoshi=array($_POST['time']);
	//	$systemparameters['txtime']=serialize($_POST['time']);
     //   $systemparameters['jingtaitime']=serialize($_POST['jingtaitime']);
		$_system->system_update($systemparameters);
		
		alert('保存成功.','?');
}

?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/table.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script src="resources/scripts/jquery-1.3.2.min.js"></script>
    <link href="../layui-master/dist/css/layui.css" rel="stylesheet" type="text/css">
    <script src="../layui-master/dist/layui.js"></script>
<title>级别参数</title>
<script>
$(function(){
		$("input[class=hour]").blur(function(){
			var reg=/^([0-9]|1[0-9]|2[0-4]){1}(:[0-5][0-9]){0,1}$/;
			if(reg.test(this.value)){
				
			}else{
				this.value="";
				
			}
		})
	


})


</script>
</head>
<body>
<form name="form1" method="post" action="?">
<table width="100%" cellpadding="3" cellspacing="1" border="0" align="center" class="layui-table" lay-skin="line">
      <tr>
        <td height="10" colspan="3" align="center">系统参数</td>
      </tr>
      <tr >
        <td align="center">提现倍数</td>
        <td align="center"><input name="txbs" type="text" id="txbs" value="<?=$systemparameters['txbs']?>" size="7" maxlength="7"></td>
      </tr>
      <tr>
        <td align="center">提现最小金额</td>
        <td align="center"><input name="txmix" type="text" id="txmix" value="<?=$systemparameters['txmix']?>" size="7" maxlength="7"></td>
      </tr>
    <tr >
        <td align="center">奖金转换倍数</td>
        <td align="center"><input name="fanli" type="text" id="fanli" value="<?=$systemparameters['fanli']?>" size="8" maxlength="10"> </td>
    </tr>
<!--    <tr>
        <td align="center">手续费</td>
        <td align="center"><input name="sl" type="text" id="sl" value="<?/*=$systemparameters['sl']*/?>" size="5" maxlength="4">
        %</td>
      </tr>-->
<!--    <tr>
        <td align="center">重复消费</td>
        <td align="center"><input name="chongfuxiaofei" type="text" id="chongfuxiaofei" value="<?/*=$systemparameters['chongfuxiaofei']*/?>" size="5" maxlength="4">
        %</td>
      </tr>-->
<!--    <tr>
        <td align="center">复投</td>
        <td align="center"><input name="wlf" type="text" id="wlf" value="<?/*=$systemparameters['wlf']*/?>" size="8" maxlength="8">%
        </td>
      </tr>-->
    <!--  <tr style="display: none">
        <td align="center">增长率</td>
        <td align="center"><input name="txsl" type="text" id="txsl" value="<?/*=$systemparameters['txsl']*/?>" size="5" maxlength="4">
        %</td>
      </tr>-->
    <tr>
        <td align="center">爱心基金</td>
        <td align="center"><input name="aixinjijin" type="text" id="aixinjijin" value="<?=$systemparameters['aixinjijin']?>" size="5" maxlength="4">
        %</td>
      </tr>
    <tr>
        <td align="center">手续费</td>
        <td align="center"><input name="jmf2" type="text" id="jmf2" value="<?=$systemparameters['jmf2']?>" size="5" maxlength="4">
        %</td>
      </tr>
   <!-- <tr>
        <td align="center">单价</td>
        <td align="center"><input name="danjia" type="text" id="danjia" value="<?/*=$systemparameters['danjia']*/?>" size="5" maxlength="4">
        </td>
      </tr>
    <tr>
        <td align="center">提现兑充</td>
        <td align="center"><input name="jmf1" type="text" id="jmf1" value="<?/*=$systemparameters['jmf1']*/?>" size="5" maxlength="4">%
        </td>
      </tr>-->
       <tr >
        <td align="center">提现星期</td>
        <td align="center">
         <input type="checkbox" name="time[]"  value="8" onclick="affirm(this)" <?php if(in_array(8,$time))echo "checked='checked'";?>/>不限
         <input type="checkbox" name="time[]"  value="1" onclick="affirm(this)" <?php if(in_array(1,$time))echo "checked='checked'";?>/>星期一
         <input type="checkbox" name="time[]"  value="2" onclick="affirm(this)" <?php if(in_array(2,$time))echo "checked='checked'";?>/>星期二
         <input type="checkbox" name="time[]"  value="3" onclick="affirm(this)" <?php if(in_array(3,$time))echo "checked='checked'";?>/>星期三
         <input type="checkbox" name="time[]"  value="4" onclick="affirm(this)" <?php if(in_array(4,$time))echo "checked='checked'";?>/>星期四
         <input type="checkbox" name="time[]"  value="5" onclick="affirm(this)" <?php if(in_array(5,$time))echo "checked='checked'";?>/>星期五
         <input type="checkbox" name="time[]"  value="6" onclick="affirm(this)" <?php if(in_array(6,$time))echo "checked='checked'";?>/>星期六
         <input type="checkbox" name="time[]"  value="7" onclick="affirm(this)" <?php if(in_array(0,$time))echo "checked='checked'";?>/>星期天
      </td>
      </tr>
    <tr >
        <td align="center">发放星期</td>
        <td align="center">
            <input type="checkbox" name="jingtaitime[]"  value="8" onclick="affirm(this)" <?php if(in_array(8,$jingtaitime))echo "checked='checked'";?>/>不限
            <input type="checkbox" name="jingtaitime[]"  value="1" onclick="affirm(this)" <?php if(in_array(1,$jingtaitime))echo "checked='checked'";?>/>星期一
            <input type="checkbox" name="jingtaitime[]"  value="2" onclick="affirm(this)" <?php if(in_array(2,$jingtaitime))echo "checked='checked'";?>/>星期二
            <input type="checkbox" name="jingtaitime[]"  value="3" onclick="affirm(this)" <?php if(in_array(3,$jingtaitime))echo "checked='checked'";?>/>星期三
            <input type="checkbox" name="jingtaitime[]"  value="4" onclick="affirm(this)" <?php if(in_array(4,$jingtaitime))echo "checked='checked'";?>/>星期四
            <input type="checkbox" name="jingtaitime[]"  value="5" onclick="affirm(this)" <?php if(in_array(5,$jingtaitime))echo "checked='checked'";?>/>星期五
            <input type="checkbox" name="jingtaitime[]"  value="6" onclick="affirm(this)" <?php if(in_array(6,$jingtaitime))echo "checked='checked'";?>/>星期六
            <input type="checkbox" name="jingtaitime[]"  value="0" onclick="affirm(this)" <?php if(in_array(0,$jingtaitime))echo "checked='checked'";?>/>星期天
        </td>
    </tr>
      <tr>
        <td align="center">提现时间</td>
        <td align="center">
        <input type="text" name="ds1" class="hour" value="<?php echo $systemparameters['ds1']?>" size="4"/>:00至
        <input type="text" name="ds2" value="<?php echo $systemparameters['ds2'];?>" class="hour" size="4"/>:00
        <font size="1">例如  7-20</font>
        </td>
      </tr>

     
      <tr>
        <td align="center">默认一级密码</td>
        <td align="center"><input name="password1" type="text" id="password1" value="<?=$systemparameters['password1']?>" maxlength="20">
        </td>
      </tr>
      <tr>
        <td align="center">默认二级密码</td>
        <td align="center"><input name="password2" type="text" id="password2" value="<?=$systemparameters['password2']?>" maxlength="20">
        </td>
      </tr>
    <tr>
        <td align="center">默认三级密码</td>
        <td align="center"><input name="password3" type="text" id="password3" value="<?=$systemparameters['password3']?>" maxlength="20">
        </td>
      </tr>
      <tr style="display:none">
        <td align="center">短信接口帐号</td>
        <td align="center"><input name="duanxinzhanghao" type="text" id="duanxinzhanghao" value="<?=$systemparameters['duanxinzhanghao']?>" maxlength="20">
        </td>
      </tr>
      <tr style="display:none">
        <td align="center">短信接口密码</td>
        <td align="center"><input name="duanxinmima" type="password" id="duanxinmima" value="<?=$systemparameters['duanxinmima']?>" maxlength="20">
        </td>
      </tr>
 <!--   <tr>
        <td align="center">拆分开关</td>
        <td align="center"><input type="radio" name="chaifen" id="chaifen" value="1" <?php /*if($systemparameters['chaifen']==1){ */?> checked <?php /*}*/?>>
            自动拆分
            <input type="radio" name="chaifen" id="chaifen" value="0" <?php /*if($systemparameters['chaifen']==0){ */?> checked <?php /*}*/?>>
            手动拆分 </td>
    </tr>
    <tr>
        <td align="center">封顶开关</td>
        <td align="center"><input type="radio" name="fengding" id="fengding" value="1" <?php /*if($systemparameters['fengding']==1){ */?> checked <?php /*}*/?>>
            日封顶
            <input type="radio" name="fengding" id="fengding" value="2" <?php /*if($systemparameters['fengding']==2){ */?> checked <?php /*}*/?>>
            总封顶 </td>
    </tr>-->
       <tr >
        <td align="center">系统开关</td>
        <td align="center"><input name="xtkg" type="radio" id="xtkg" value="1"  <?php if($systemparameters['xtkg']==1){ ?> checked <?php }?>>
          开
          <input type="radio" name="xtkg" id="xtkg" value="0" <?php if($systemparameters['xtkg']==0){ ?> checked <?php }?>>
          关
        </td>
      </tr>

      
      <tr>
        <td align="center">安置图开关</td>
        <td align="center"><input type="radio" name="azkg" id="azkg" value="1" <?php if($systemparameters['azkg']==1){ ?> checked <?php }?>>
开
    <input type="radio" name="azkg" id="azkg" value="0" <?php if($systemparameters['azkg']==0){ ?> checked <?php }?>>
    关 </td>
      </tr>

      <tr >
        <td align="center">推荐图开关</td>
        <td align="center"><input type="radio" name="tjkg" id="tjkg" value="1" <?php if($systemparameters['tjkg']==1){ ?> checked <?php }?>>
开
    <input type="radio" name="tjkg" id="tjkg" value="0" <?php if($systemparameters['tjkg']==0){ ?> checked <?php }?>>
    关</td>
      </tr>
      <tr>
        <td align="center">奖金转换开关</td>
        <td align="center"><input type="radio" name="cqu" id="tjkg" value="1" <?php if($systemparameters['isb2']==1){ ?> checked <?php }?>>
开
    <input type="radio" name="cqu" id="tjkg" value="0" <?php if($systemparameters['isb2']==0){ ?> checked <?php }?>>
    关</td>
      </tr>



    <tr>
        <td align="center">奖金转账开关</td>
        <td align="center"><input type="radio" name="isb3" id="isb3" value="1" <?php if($systemparameters['isb3']==1){ ?> checked <?php }?>>
            开
            <input type="radio" name="isb3" id="isb3" value="0" <?php if($systemparameters['isb3']==0){ ?> checked <?php }?>>
            关</td>
    </tr>

      <tr>
        <td align="center">修改资料开关</td>
        <td align="center"><input type="radio" name="ziliao" id="ziliao" value="1" <?php if($systemparameters['ziliao']==1){ ?> checked <?php }?>>
开
    <input type="radio" name="ziliao" id="ziliao" value="0" <?php if($systemparameters['ziliao']==0){ ?> checked <?php }?>>
    关</td>
      </tr>
<!--      <tr >
        <td align="center">拆分功能关闭</td>
        <td align="center"><input type="radio" name="bdbonus" id="bdbonus" value="1" <?php /*if($systemparameters['bdbonus']==1){ */?> checked <?php /*}*/?>>
    开
    <input type="radio" name="bdbonus" id="bdbonus" value="0" <?php /*if($systemparameters['bdbonus']==0){ */?> checked <?php /*}*/?>>
    关</td>
      </tr>-->
      
	  <tr style="display:none">
        <td align="center">服务奖方案</td>
        <td align="center">
          <select name="ff" id="ff">
            <option value="1" <?php if($systemparameters['ff']==1){?> selected <?php }?>>十代</option>
            <option value="2" <?php if($systemparameters['ff']==2){?> selected <?php }?>>十层</option>
        </select></td>
      </tr>
      
      <tr style="display:none">
        <td align="center">第三市场方案</td>
        <td align="center">
          <select name="ms" id="ms">
            <option value="1" <?php if($systemparameters['ms']==1){?> selected <?php }?>>始终开启</option>
            <option value="2" <?php if($systemparameters['ms']==2){?> selected <?php }?>>不开启</option>
            <option value="3" <?php if($systemparameters['ms']==3){?> selected <?php }?>>一星以上开启</option>
            <option value="4" <?php if($systemparameters['ms']==4){?> selected <?php }?>>二星以上开启</option>
            <option value="5" <?php if($systemparameters['ms']==5){?> selected <?php }?>>三星以上开启</option>
            <option value="6" <?php if($systemparameters['ms']==6){?> selected <?php }?>>四星以上开启</option>
            <option value="7" <?php if($systemparameters['ms']==7){?> selected <?php }?>>五星以上开启</option>
            <option value="8" <?php if($systemparameters['ms']==8){?> selected <?php }?>>一总以上开启</option>
            <option value="9" <?php if($systemparameters['ms']==9){?> selected <?php }?>>二总以上开启</option>
            <option value="10" <?php if($systemparameters['ms']==10){?> selected <?php }?>>三总以上开启</option>
            <option value="11" <?php if($systemparameters['ms']==11){?> selected <?php }?>>四总以上开启</option>
            <option value="12" <?php if($systemparameters['ms']==12){?> selected <?php }?>>五总以上开启</option>
          </select></td>
      </tr>
      
      <tr>
        <td align="center">在线客服1</td>
        <td align="center"><input name="qq1" type="text" id="qq1" value="<?=$systemparameters['qq1']?>" size="12" maxlength="12"></td>
      </tr>
      <tr>
        <td align="center">在线客服2</td>
        <td align="center"><input name="qq2" type="text" id="qq2" value="<?=$systemparameters['qq2']?>" size="12" maxlength="12"></td>
      </tr>
      <tr>
        <td align="center">在线客服3</td>
        <td align="center"><input name="qq3" type="text" id="qq3" value="<?=$systemparameters['qq3']?>" size="12" maxlength="12"></td>
      </tr>
      <tr>
        <td align="center">在线客服4</td>
        <td align="center"><input name="qq4" type="text" id="qq4" value="<?=$systemparameters['qq4']?>" size="12" maxlength="12"></td>
      </tr>
       <tr>
        <td align="center">24小时热线</td>
        <td align="center"><input name="rexian" type="text" id="rexian" value="<?=$systemparameters['rexian']?>" size="12" maxlength="12"></td>
      </tr>
       <tr>
        <td align="center">售后服务</td>
        <td align="center"><input name="shouhou" type="text" id="shouhou" value="<?=$systemparameters['shouhou']?>" size="12" maxlength="12"></td>
      </tr>

	  <tr>
        <td align="center">阿里云通信access_key_id</td>
        <td align="center"><input name="access_key_id" type="text" id="access_key_id" value="<?=$systemparameters['access_key_id']?>" size="30" maxlength="255"></td>
      </tr>

	   <tr>
        <td align="center">阿里云通信access_key_secret</td>
        <td align="center"><input name="access_key_secret" type="text" id="access_key_secret" value="<?=$systemparameters['access_key_secret']?>" size="30" maxlength="255"></td>
      </tr>

	   <tr>
        <td align="center">管理员通知手机号</td>
        <td align="center"><input name="sms_admin_tel" type="text" id="sms_admin_tel" value="<?=$systemparameters['sms_admin_tel']?>" size="30" maxlength="11"></td>
      </tr>

	  <tr>
        <td align="center">微信appid</td>
        <td align="center"><input name="w_appid" type="text" id="w_appid" value="<?=$systemparameters['w_appid']?>" size="30" maxlength="255"></td>
      </tr>

	   <tr>
        <td align="center">微信appsecret</td>
        <td align="center"><input name="w_appsercret" type="text" id="w_appsercret" value="<?=$systemparameters['w_appsercret']?>" size="30" maxlength="255"></td>
      </tr>

	   <tr>
        <td align="center">微信商户号</td>
        <td align="center"><input name="w_mchid" type="text" id="w_mchid" value="<?=$systemparameters['w_mchid']?>" size="30" maxlength="255"></td>
      </tr>

	   <tr>
        <td align="center">微信支付秘钥</td>
        <td align="center"><input name="w_key" type="text" id="w_key" value="<?=$systemparameters['w_key']?>" size="30" maxlength="255"></td>
      </tr>


      <tr>
        <td colspan="3" align="center"><input name="button" type="submit" class="layui-btn layui-btn-warm" id="button" value="保存"></td>
      </tr>
    </table>
</form>
</body>
</html>
<script language="javascript">

<!--

function affirm(t)

{  

var ipt = document.getElementsByTagName("input");    

var i = 0;    

var allownum = 14;//定义最多能选择的个数

for(var j = 0; j < ipt.length; j++)  

{       

if(ipt[j].type == "checkbox" && ipt[j].checked)       

i++;   

}    

if(i > allownum)    

{        

alert("你最多只能选择"+ allownum +"项！");        

t.checked = false;    

}


}

function sss()

{  

var ipt = document.getElementsByTagName("input");    

var i = 0;    


for(var j = 0; j < ipt.length; j++)  

{       

if(ipt[j].type == "checkbox" && ipt[j].checked)       

i++;   

}  


if(i === 0)    

{        

alert("请选择提现星期");        
return false;    

}

return true;
}

function lua(){
	var hh=document.getElementsByClassName("hour");
	var reg=/^([0-9]|1[0-9]|2[0-4]){1}(:[0-5][0-9]){0,1}$/;
	var jk;
	
	for(var c=0;c<=hh.length;c++){
	
		if(reg.test(hh[c].value)){
			jk++;
		}else{
			alert("请填写提现时间");
			hh[c].focus();
			return false;
		}
	}
	
	if(jk ==2){
		return true;
	}
}


//-->

</script>